<?php
/**
* @file Commentdownm.php
* @synopsis  评论 顶一下
* @author Yee, <rlk002@gmail.com>
* @version 1.0
* @date 2015年7月7日18:54:18
*/

defined('BASEPATH') OR exit('No direct script access allowed');

class Commentdownm extends CI_Model
{
    function __construct(){}

    /**
     * 插入点踩记录
     * @param $sets
     * @return mixed
     */
    public function insert_commentdown($sets)
    {
        return $result = $this->db->insert("ml_commentdown",$sets);
    }

    /**
     * 删除点踩记录 (只删除一条)
     * @param $query
     * @return mixed
     */
    public function remove_commentdown($query)
    {
        if (!$query) return false;

        return $this->db->where($query)->delete("ml_commentdown");
    }

    /**
     * 获取点踩数量
     * @param $query
     * @return mixed
     */
    public function get_commentdown_count($query)
    {
        return $result = $this->db->where($query)->count_all_results("ml_commentdown");
    }
}
